/**
 * Created by luyanfei on 16-9-28.
 */

var ExtractTextPlugin = require("extract-text-webpack-plugin");
var webpack = require("webpack");

const p = require('path');

module.exports = {
    entry: './client/entry.js',
    resolve: {
        extensions: ['', '.js']
    },
    output: {
        path: p.join(__dirname, 'public'),
        filename: 'bundle.js'
    },
    module: {
        loaders: [
            {
                test: /\.css$/,
                loader: ExtractTextPlugin.extract("style-loader", "css-loader")
            },
            {
                test: /\.(eot|woff|woff2|ttf|svg)$/,
                loader: "file?name=./fonts/[name][hash].[ext]"
            }
        ]
    },
    plugins: [
        new ExtractTextPlugin('./stylesheets/bundle.css'),
        new webpack.optimize.UglifyJsPlugin(),
        new webpack.optimize.DedupePlugin()
    ]
};